home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROCS.ZIP
/
GENER.ICN
< prev
next >
Wrap
Text File
|
1992-09-28
|
1KB
|
57 lines
############################################################################
#
# File: gener.icn
#
# Subject: Procedures to generate miscellaneous sequences
#
# Author: Ralph E. Griswold
#
# Date: September 21, 1991
#
###########################################################################
#
# These procedures generate sequences of results.
#
# days() days of the week.
#
# hex() sequence of hexadecimal codes for numbers
# from 0 to 255
#
# label(s,i) sequence of labels with prefix s starting at i
#
# months() months of the year
#
# octal() sequence of octal codes for numbers from 0 to 255
#
# star(s) sequence consisting of the closure of s
# starting with the empty string and continuing
# in lexical order as given in s
#
############################################################################
procedure days()
suspend "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" |
"Friday" | "Saturday"
end
procedure hex()
suspend !"0123456789abcdef" || !"0123456789abcdef"
end
procedure label(s,i)
suspend s || (i | (i +:= |1))
end
procedure months()
suspend "January" | "February" | "March" | "April" | "May" | "June" |
"July" | "August" | "September" | "October" | "November" | "December"
end
procedure octal()
suspend (0 to 3) || (0 to 7) || (0 to 7)
end
procedure star(s)
suspend "" | (star(s) || !s)
end